<?php

/**
 * This is the model class for table "sekolahmuridgurusd".
 *
 * The followings are the available columns in table 'sekolahmuridgurusd':
 * @property integer $smgsd_id
 * @property integer $smgsd_kec
 * @property integer $smgsd_jmlsekolah
 * @property integer $smgsd_jmlmurid
 * @property integer $smgsd_jmlguru
 * @property integer $smgsd_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $smgsdKec
 */
class Sekolahmuridgurusd extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Sekolahmuridgurusd the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sekolahmuridgurusd';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('smgsd_kec, smgsd_jmlsekolah, smgsd_jmlmurid, smgsd_jmlguru, smgsd_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('smgsd_id, smgsd_kec, smgsd_jmlsekolah, smgsd_jmlmurid, smgsd_jmlguru, smgsd_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'smgsdKec' => array(self::BELONGS_TO, 'Kecamatan', 'smgsd_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'smgsd_id' => 'Smgsd',
			'smgsd_kec' => 'Smgsd Kec',
			'smgsd_jmlsekolah' => 'Smgsd Jmlsekolah',
			'smgsd_jmlmurid' => 'Smgsd Jmlmurid',
			'smgsd_jmlguru' => 'Smgsd Jmlguru',
			'smgsd_tahun' => 'Smgsd Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('smgsd_id',$this->smgsd_id);
		$criteria->compare('smgsd_kec',$this->smgsd_kec);
		$criteria->compare('smgsd_jmlsekolah',$this->smgsd_jmlsekolah);
		$criteria->compare('smgsd_jmlmurid',$this->smgsd_jmlmurid);
		$criteria->compare('smgsd_jmlguru',$this->smgsd_jmlguru);
		$criteria->compare('smgsd_tahun',$this->smgsd_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}